class CreateTagsTable < ActiveRecord::Migration
  def self.up
    create_table :tags do |t|
      t.column :name, :string, :null => false
      t.column :created_on, :timestamp, :null => false
      t.column :updated_on, :timestamp, :null => false
    end

    create_table(:contents_tags, :id => false) do |t|
      t.column :content_id, :integer, :null => false
      t.column :tag_id, :integer, :null => false
      t.column :created_on, :timestamp, :null => false
      t.column :updated_on, :timestamp, :null => false
    end
  end

  def self.down
    drop_table :tags
    drop_table :contents_tags
  end
end
